package com.easy.service.impl;

import com.easy.bean.Carousel;
import com.easy.mapper.CarouselDao;
import com.easy.service.CarouselService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class CarouselServiceImpl implements CarouselService {

    @Autowired
    private CarouselDao carouselDao;

    @Override
    public List<Carousel> getAll() {
        return carouselDao.getAll();
    }

    @Override
    public Carousel add(Carousel carousel) {
        carouselDao.add(carousel);
        return carousel;
    }

    @Override
    public int delete(Integer id) {
        return carouselDao.delete(id);
    }
}
